home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / parser.jar / com / sun / xml / parser / Parser.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-02-23  |  34.4 KB  |  2,028 lines

  1. package com.sun.xml.parser;
  2.  
  3. import com.sun.xml.util.XmlChars;
  4. import java.io.IOException;
  5. import java.net.URL;
  6. import java.util.Enumeration;
  7. import java.util.Hashtable;
  8. import java.util.Locale;
  9. import java.util.Vector;
  10. import org.xml.sax.DTDHandler;
  11. import org.xml.sax.DocumentHandler;
  12. import org.xml.sax.EntityResolver;
  13. import org.xml.sax.ErrorHandler;
  14. import org.xml.sax.InputSource;
  15. import org.xml.sax.Locator;
  16. import org.xml.sax.SAXException;
  17. import org.xml.sax.SAXParseException;
  18.  
  19. public class Parser implements org.xml.sax.Parser {
  20.    // $FF: renamed from: in com.sun.xml.parser.InputEntity
  21.    private InputEntity field_0;
  22.    private AttributeListImpl attTmp;
  23.    private StringBuffer strTmp;
  24.    private char[] nameTmp;
  25.    private NameCache nameCache;
  26.    private char[] charTmp = new char[2];
  27.    private boolean isValidating = false;
  28.    private boolean fastStandalone = false;
  29.    private boolean isInAttribute = false;
  30.    private boolean inExternalPE;
  31.    private boolean doLexicalPE;
  32.    private boolean donePrologue;
  33.    private boolean isStandalone;
  34.    private String rootElementName;
  35.    private boolean ignoreDeclarations;
  36.    private SimpleHashtable elements = new SimpleHashtable(47);
  37.    private SimpleHashtable params = new SimpleHashtable(7);
  38.    Hashtable notations = new Hashtable(7);
  39.    SimpleHashtable entities = new SimpleHashtable(17);
  40.    private DocumentHandler docHandler;
  41.    private DTDHandler dtdHandler;
  42.    private EntityResolver resolver;
  43.    private ErrorHandler errHandler;
  44.    private Locale locale;
  45.    private Locator locator = new DocLocator(this);
  46.    private DtdEventListener dtdListener;
  47.    private LexicalEventListener lexicalListener;
  48.    private static final boolean supportValidation = true;
  49.    static final String strANY = "ANY";
  50.    static final String strEMPTY = "EMPTY";
  51.    private static final ListenerBase defaultHandler = new ListenerBase();
  52.    private static final String XmlLang = "xml:lang";
  53.    static final Catalog messages = new Catalog();
  54.    // $FF: synthetic field
  55.    static Class class$com$sun$xml$parser$Parser;
  56.  
  57.    public Parser() {
  58.       this.setHandlers();
  59.    }
  60.  
  61.    // $FF: synthetic method
  62.    static InputEntity access$0(Parser var0) {
  63.       return var0.field_0;
  64.    }
  65.  
  66.    void afterDocument() {
  67.    }
  68.  
  69.    void afterRoot() throws SAXException {
  70.    }
  71.  
  72.    private void builtin(String var1, String var2) {
  73.       InternalEntity var3 = new InternalEntity(var1, var2.toCharArray());
  74.       this.entities.put(var1, var3);
  75.    }
  76.  
  77.    public Locale chooseLocale(String[] var1) throws SAXException {
  78.       Locale var2 = messages.chooseLocale(var1);
  79.       if (var2 != null) {
  80.          this.setLocale(var2);
  81.       }
  82.  
  83.       return var2;
  84.    }
  85.  
  86.    // $FF: synthetic method
  87.    static Class class$(String var0) {
  88.       try {
  89.          return Class.forName(var0);
  90.       } catch (ClassNotFoundException var2) {
  91.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  92.       }
  93.    }
  94.  
  95.    private void content(ElementDecl var1, boolean var2, ElementValidator var3) throws IOException, SAXException {
  96.       while(true) {
  97.          if (this.field_0.peekc('<')) {
  98.             if (this.maybeElement(var3)) {
  99.                continue;
  100.             }
  101.  
  102.             if (this.field_0.peekc('/')) {
  103.                return;
  104.             }
  105.  
  106.             if (this.maybeComment(true) || this.maybePI(true) || this.field_0.unparsedContent(this.docHandler, var3, var1 != null && var1.ignoreWhitespace, this.isStandalone && this.isValidating && !var1.isFromInternalSubset ? "V-023" : null)) {
  107.                continue;
  108.             }
  109.  
  110.             char var4 = this.getc();
  111.             this.fatal("P-079", new Object[]{Integer.toHexString(var4), new Character(var4)});
  112.          }
  113.  
  114.          if (var1 != null && var1.ignoreWhitespace && this.field_0.ignorableWhitespace(this.docHandler)) {
  115.             if (this.isValidating && this.isStandalone && !var1.isFromInternalSubset) {
  116.                this.error("V-011", new Object[]{var1.name});
  117.             }
  118.          } else if (!this.field_0.parsedContent(this.docHandler, var3)) {
  119.             if (!this.field_0.isEOF()) {
  120.                if (this.maybeReferenceInContent(var1, var3)) {
  121.                   continue;
  122.                }
  123.  
  124.                throw new InternalError();
  125.             }
  126.  
  127.             if (!var2) {
  128.                this.fatal("P-035");
  129.             }
  130.  
  131.             return;
  132.          }
  133.       }
  134.    }
  135.  
  136.    private boolean defaultAttributes(AttributeListImpl var1, ElementDecl var2) throws SAXException {
  137.       boolean var3 = false;
  138.       Enumeration var4 = var2.attributes.keys();
  139.  
  140.       while(var4.hasMoreElements()) {
  141.          String var5 = (String)var4.nextElement();
  142.          String var6 = var1.getValue(var5);
  143.          if (var6 == null) {
  144.             AttributeDecl var7 = (AttributeDecl)var2.attributes.get(var5);
  145.             if (this.isValidating && var7.isRequired) {
  146.                this.error("V-009", new Object[]{var5});
  147.             }
  148.  
  149.             if (var7.defaultValue != null) {
  150.                if (this.isValidating && this.isStandalone && !var7.isFromInternalSubset) {
  151.                   this.error("V-010", new Object[]{var5});
  152.                }
  153.  
  154.                var1.addAttribute(var5, var7.type, var7.defaultValue, var7.defaultValue, false);
  155.                var3 = true;
  156.             }
  157.          }
  158.       }
  159.  
  160.       return var3;
  161.    }
  162.  
  163.    void error(String var1, Object[] var2) throws SAXException {
  164.       SAXParseException var3 = new SAXParseException(messages.getMessage(this.locale, var1, var2), this.locator);
  165.       this.errHandler.error(var3);
  166.    }
  167.  
  168.    private void expandEntityInContent(ElementDecl var1, String var2, ElementValidator var3) throws SAXException, IOException {
  169.       Object var4 = this.entities.get(var2);
  170.       InputEntity var5 = this.field_0;
  171.       if (var4 == null) {
  172.          this.fatal("P-014", new Object[]{var2});
  173.       }
  174.  
  175.       if (var4 instanceof InternalEntity) {
  176.          InternalEntity var6 = (InternalEntity)var4;
  177.          if (this.isValidating && this.isStandalone && !var6.isFromInternalSubset) {
  178.             this.error("V-002", new Object[]{var2});
  179.          }
  180.  
  181.          this.pushReader(var6.buf, var2, true);
  182.          this.content(var1, true, var3);
  183.          if (this.field_0 != var5 && !this.field_0.isEOF()) {
  184.             while(this.field_0.isInternal()) {
  185.                this.field_0 = this.field_0.pop();
  186.             }
  187.  
  188.             this.fatal("P-052", new Object[]{var2});
  189.          }
  190.  
  191.          this.lexicalListener.endParsedEntity(var2, true);
  192.          this.field_0 = this.field_0.pop();
  193.       } else {
  194.          if (!(var4 instanceof ExternalEntity)) {
  195.             throw new InternalError(var2);
  196.          }
  197.  
  198.          ExternalEntity var7 = (ExternalEntity)var4;
  199.          if (var7.notation != null) {
  200.             this.fatal("P-053", new Object[]{var2});
  201.          }
  202.  
  203.          if (this.isValidating && this.isStandalone && !var7.isFromInternalSubset) {
  204.             this.error("V-002", new Object[]{var2});
  205.          }
  206.  
  207.          this.externalParsedEntity(var1, var7, var3);
  208.       }
  209.  
  210.    }
  211.  
  212.    private void expandEntityInLiteral(String var1, SimpleHashtable var2, boolean var3) throws SAXException, IOException {
  213.       Object var4 = var2.get(var1);
  214.       if (var4 instanceof InternalEntity) {
  215.          InternalEntity var5 = (InternalEntity)var4;
  216.          if (this.isValidating && this.isStandalone && !var5.isFromInternalSubset) {
  217.             this.error("V-002", new Object[]{var1});
  218.          }
  219.  
  220.          this.pushReader(var5.buf, var1, var5.isPE ^ true);
  221.       } else if (var4 instanceof ExternalEntity) {
  222.          if (!var3) {
  223.             this.fatal("P-013", new Object[]{var1});
  224.          }
  225.  
  226.          this.pushReader((ExternalEntity)var4);
  227.       } else if (var4 == null) {
  228.          this.fatal(var2 == this.params ? "V-022" : "P-014", new Object[]{var1});
  229.       }
  230.  
  231.    }
  232.  
  233.    private void externalParameterEntity(ExternalEntity var1) throws IOException, SAXException {
  234.       if (!this.isStandalone || !this.fastStandalone) {
  235.          this.inExternalPE = true;
  236.  
  237.          try {
  238.             this.pushReader(var1);
  239.          } catch (IOException var5) {
  240.             this.fatal("P-082", new Object[]{var1.systemId}, var5);
  241.          }
  242.  
  243.          InputEntity var2 = this.field_0;
  244.  
  245.          try {
  246.             this.maybeTextDecl();
  247.          } catch (IOException var4) {
  248.             this.field_0 = this.field_0.pop();
  249.             this.fatal("P-082", new Object[]{var1.systemId}, var4);
  250.          }
  251.  
  252.          while(!var2.isEOF()) {
  253.             if (this.field_0.isEOF()) {
  254.                this.field_0 = this.field_0.pop();
  255.             } else {
  256.                this.doLexicalPE = false;
  257.                if (!this.maybeWhitespace() && !this.maybePEReference()) {
  258.                   this.doLexicalPE = true;
  259.                   if (!this.maybeMarkupDecl() && !this.maybeConditionalSect()) {
  260.                      break;
  261.                   }
  262.                }
  263.             }
  264.          }
  265.  
  266.          if (!var2.isEOF()) {
  267.             this.fatal("P-059", new Object[]{this.field_0.getName()});
  268.          }
  269.  
  270.          this.field_0 = this.field_0.pop();
  271.          this.inExternalPE = this.field_0.isDocument() ^ true;
  272.          this.doLexicalPE = false;
  273.       }
  274.    }
  275.  
  276.    private boolean externalParsedEntity(ElementDecl var1, ExternalEntity var2, ElementValidator var3) throws IOException, SAXException {
  277.       if (!this.pushReader(var2)) {
  278.          if (!this.isInAttribute) {
  279.             this.lexicalListener.endParsedEntity(var2.name, false);
  280.          }
  281.  
  282.          return false;
  283.       } else {
  284.          this.maybeTextDecl();
  285.          this.content(var1, true, var3);
  286.          if (!this.field_0.isEOF()) {
  287.             this.fatal("P-058", new Object[]{var2.name});
  288.          }
  289.  
  290.          this.field_0 = this.field_0.pop();
  291.          if (!this.isInAttribute) {
  292.             this.lexicalListener.endParsedEntity(var2.name, true);
  293.          }
  294.  
  295.          return true;
  296.       }
  297.    }
  298.  
  299.    private void fatal(String var1) throws SAXException {
  300.       this.fatal(var1, (Object[])null, (Exception)null);
  301.    }
  302.  
  303.    private void fatal(String var1, Object[] var2) throws SAXException {
  304.       this.fatal(var1, var2, (Exception)null);
  305.    }
  306.  
  307.    private void fatal(String var1, Object[] var2, Exception var3) throws SAXException {
  308.       SAXParseException var4 = new SAXParseException(messages.getMessage(this.locale, var1, var2), this.locator, var3);
  309.       this.errHandler.fatalError(var4);
  310.       throw var4;
  311.    }
  312.  
  313.    public DTDHandler getDTDHandler() {
  314.       return this.dtdHandler;
  315.    }
  316.  
  317.    public DocumentHandler getDocumentHandler() {
  318.       return this.docHandler;
  319.    }
  320.  
  321.    public EntityResolver getEntityResolver() {
  322.       return this.resolver;
  323.    }
  324.  
  325.    public ErrorHandler getErrorHandler() {
  326.       return this.errHandler;
  327.    }
  328.  
  329.    private ContentModel getFrequency(ContentModel var1) throws IOException, SAXException {
  330.       char var2 = this.getc();
  331.       if (var2 != '?' && var2 != '+' && var2 != '*') {
  332.          this.ungetc();
  333.          return var1;
  334.       } else {
  335.          this.strTmp.append(var2);
  336.          if (var1 == null) {
  337.             return null;
  338.          } else if (var1.type == 0) {
  339.             var1.type = var2;
  340.             return var1;
  341.          } else {
  342.             return this.newContentModel(var2, var1);
  343.          }
  344.       }
  345.    }
  346.  
  347.    public Locale getLocale() {
  348.       return this.locale;
  349.    }
  350.  
  351.    private String getMarkupDeclname(String var1, boolean var2) throws IOException, SAXException {
  352.       this.whitespace(var1);
  353.       String var3 = this.maybeGetName();
  354.       if (var3 == null) {
  355.          this.fatal("P-005", new Object[]{messages.getMessage(this.locale, var1)});
  356.       }
  357.  
  358.       return var3;
  359.    }
  360.  
  361.    private void getMixed(String var1, InputEntity var2) throws IOException, SAXException {
  362.       this.maybeWhitespace();
  363.       if (!this.peek(")*") && !this.peek(")")) {
  364.          Vector var3 = null;
  365.          if (this.isValidating) {
  366.             var3 = new Vector();
  367.          }
  368.  
  369.          while(this.peek("|")) {
  370.             this.strTmp.append('|');
  371.             this.maybeWhitespace();
  372.             String var4 = this.maybeGetName();
  373.             if (var4 == null) {
  374.                this.fatal("P-042", new Object[]{var1, Integer.toHexString(this.getc())});
  375.             }
  376.  
  377.             if (this.isValidating) {
  378.                if (var3.contains(var4)) {
  379.                   this.error("V-015", new Object[]{var4});
  380.                } else {
  381.                   var3.addElement(var4);
  382.                }
  383.             }
  384.  
  385.             this.strTmp.append(var4);
  386.             this.maybeWhitespace();
  387.          }
  388.  
  389.          if (!this.peek(")*")) {
  390.             this.fatal("P-043", new Object[]{var1, new Character(this.getc())});
  391.          }
  392.  
  393.          if (this.isValidating && this.field_0 != var2) {
  394.             this.error("V-014", new Object[]{var1});
  395.          }
  396.  
  397.          this.strTmp.append(')');
  398.       } else {
  399.          if (this.isValidating && this.field_0 != var2) {
  400.             this.error("V-014", new Object[]{var1});
  401.          }
  402.  
  403.          this.strTmp.append(')');
  404.       }
  405.    }
  406.  
  407.    private String getMixedOrChildren(ElementDecl var1) throws IOException, SAXException {
  408.       this.strTmp = new StringBuffer();
  409.       this.nextChar('(', "F-028", var1.name);
  410.       InputEntity var2 = this.field_0;
  411.       this.maybeWhitespace();
  412.       this.strTmp.append('(');
  413.       if (this.peek("#PCDATA")) {
  414.          this.strTmp.append("#PCDATA");
  415.          this.getMixed(var1.name, var2);
  416.          var1.ignoreWhitespace = false;
  417.       } else {
  418.          var1.model = this.getcps(var1.name, var2);
  419.          var1.ignoreWhitespace = true;
  420.       }
  421.  
  422.       return this.strTmp.toString();
  423.    }
  424.  
  425.    private String getNmtoken() throws SAXException, IOException {
  426.       char var1 = this.getc();
  427.       if (!XmlChars.isNameChar(var1)) {
  428.          this.fatal("P-006", new Object[]{new Character(var1)});
  429.       }
  430.  
  431.       return this.nameCharString(var1).name;
  432.    }
  433.  
  434.    private String getQuotedString(String var1, String var2) throws IOException, SAXException {
  435.       char var3 = this.field_0.getc();
  436.       if (var3 != '\'' && var3 != '"') {
  437.          this.fatal("P-015", new Object[]{messages.getMessage(this.locale, var1, new Object[]{var2})});
  438.       }
  439.  
  440.       this.strTmp = new StringBuffer();
  441.  
  442.       char var4;
  443.       while((var4 = this.field_0.getc()) != var3) {
  444.          this.strTmp.append(var4);
  445.       }
  446.  
  447.       return this.strTmp.toString();
  448.    }
  449.  
  450.    private char getc() throws IOException, SAXException {
  451.       if (this.inExternalPE && this.doLexicalPE) {
  452.          while(this.field_0.isEOF()) {
  453.             if (!this.field_0.isInternal() && (!this.doLexicalPE || this.field_0.isDocument())) {
  454.                this.fatal("P-064", new Object[]{this.field_0.getName()});
  455.             } else {
  456.                this.field_0 = this.field_0.pop();
  457.             }
  458.          }
  459.  
  460.          char var4;
  461.          if ((var4 = this.field_0.getc()) == '%' && this.doLexicalPE) {
  462.             String var2 = this.maybeGetName();
  463.             if (var2 == null) {
  464.                this.fatal("P-011");
  465.             }
  466.  
  467.             this.nextChar(';', "F-021", var2);
  468.             Object var3 = this.params.get(var2);
  469.             this.pushReader(" ".toCharArray(), (String)null, false);
  470.             if (var3 instanceof InternalEntity) {
  471.                this.pushReader(((InternalEntity)var3).buf, var2, false);
  472.             } else if (var3 instanceof ExternalEntity) {
  473.                this.pushReader((ExternalEntity)var3);
  474.             } else {
  475.                if (var3 != null) {
  476.                   throw new InternalError();
  477.                }
  478.  
  479.                this.fatal("V-022");
  480.             }
  481.  
  482.             this.pushReader(" ".toCharArray(), (String)null, false);
  483.             return this.field_0.getc();
  484.          } else {
  485.             return var4;
  486.          }
  487.       } else {
  488.          char var1 = this.field_0.getc();
  489.          if (var1 == '%' && this.doLexicalPE) {
  490.             this.fatal("P-080");
  491.          }
  492.  
  493.          return var1;
  494.       }
  495.    }
  496.  
  497.    private ContentModel getcps(String var1, InputEntity var2) throws IOException, SAXException {
  498.       boolean var3 = false;
  499.       char var4 = 0;
  500.       ContentModel var7 = null;
  501.       ContentModel var6 = null;
  502.       ContentModel var5 = null;
  503.  
  504.       do {
  505.          String var8 = this.maybeGetName();
  506.          if (var8 != null) {
  507.             this.strTmp.append(var8);
  508.             var7 = this.getFrequency(this.newContentModel(var8));
  509.          } else if (this.peek("(")) {
  510.             InputEntity var9 = this.field_0;
  511.             this.strTmp.append('(');
  512.             this.maybeWhitespace();
  513.             var7 = this.getFrequency(this.getcps(var1, var9));
  514.          } else {
  515.             this.fatal(var4 == 0 ? "P-039" : (var4 == ',' ? "P-037" : "P-038"), new Object[]{new Character(this.getc())});
  516.          }
  517.  
  518.          this.maybeWhitespace();
  519.          if (var3) {
  520.             char var10 = this.getc();
  521.             if (var6 != null) {
  522.                var6.next = this.newContentModel(var4, var7);
  523.                var6 = var6.next;
  524.             }
  525.  
  526.             if (var10 == var4) {
  527.                this.strTmp.append(var4);
  528.                this.maybeWhitespace();
  529.                continue;
  530.             }
  531.  
  532.             if (var10 == ')') {
  533.                this.ungetc();
  534.                continue;
  535.             }
  536.  
  537.             this.fatal(var4 == 0 ? "P-041" : "P-040", new Object[]{new Character(var10), new Character(var4)});
  538.          } else {
  539.             var4 = this.getc();
  540.             if (var4 != '|' && var4 != ',') {
  541.                var6 = var7;
  542.                var5 = var7;
  543.                this.ungetc();
  544.                continue;
  545.             }
  546.  
  547.             var3 = true;
  548.             var5 = var6 = this.newContentModel(var4, var7);
  549.             this.strTmp.append(var4);
  550.          }
  551.  
  552.          this.maybeWhitespace();
  553.       } while(!this.peek(")"));
  554.  
  555.       if (this.isValidating && this.field_0 != var2) {
  556.          this.error("V-014", new Object[]{var1});
  557.       }
  558.  
  559.       this.strTmp.append(')');
  560.       return this.getFrequency(var5);
  561.    }
  562.  
  563.    private void init() {
  564.       this.field_0 = null;
  565.       this.attTmp = new AttributeListImpl();
  566.       this.strTmp = new StringBuffer();
  567.       this.nameTmp = new char[20];
  568.       this.nameCache = new NameCache();
  569.       this.isStandalone = false;
  570.       this.rootElementName = null;
  571.       this.isInAttribute = false;
  572.       this.inExternalPE = false;
  573.       this.doLexicalPE = false;
  574.       this.donePrologue = false;
  575.       this.entities.clear();
  576.       this.notations.clear();
  577.       this.params.clear();
  578.       this.elements.clear();
  579.       this.ignoreDeclarations = false;
  580.       this.builtin("amp", "&");
  581.       this.builtin("lt", "<");
  582.       this.builtin("gt", ">");
  583.       this.builtin("quot", "\"");
  584.       this.builtin("apos", "'");
  585.       if (this.locale == null) {
  586.          this.locale = Locale.getDefault();
  587.       }
  588.  
  589.       if (this.resolver == null) {
  590.          this.resolver = new Resolver();
  591.       }
  592.  
  593.       this.setHandlers();
  594.    }
  595.  
  596.    public boolean isFastStandalone() {
  597.       return this.fastStandalone;
  598.    }
  599.  
  600.    private boolean isXmlLang(String var1) {
  601.       if (var1.length() < 2) {
  602.          return false;
  603.       } else {
  604.          char var3 = var1.charAt(1);
  605.          int var2;
  606.          if (var3 == '-') {
  607.             var3 = var1.charAt(0);
  608.             if (var3 != 'i' && var3 != 'I' && var3 != 'x' && var3 != 'X') {
  609.                return false;
  610.             }
  611.  
  612.             var2 = 1;
  613.          } else {
  614.             if ((var3 < 'a' || var3 > 'z') && (var3 < 'A' || var3 > 'Z')) {
  615.                return false;
  616.             }
  617.  
  618.             var3 = var1.charAt(0);
  619.             if ((var3 < 'a' || var3 > 'z') && (var3 < 'A' || var3 > 'Z')) {
  620.                return false;
  621.             }
  622.  
  623.             var2 = 2;
  624.          }
  625.  
  626.          while(var2 < var1.length()) {
  627.             var3 = var1.charAt(var2);
  628.             if (var3 != '-') {
  629.                break;
  630.             }
  631.  
  632.             while(true) {
  633.                ++var2;
  634.                if (var2 >= var1.length()) {
  635.                   break;
  636.                }
  637.  
  638.                var3 = var1.charAt(var2);
  639.                if ((var3 < 'a' || var3 > 'z') && (var3 < 'A' || var3 > 'Z')) {
  640.                   break;
  641.                }
  642.             }
  643.          }
  644.  
  645.          return var1.length() == var2 && var3 != '-';
  646.       }
  647.    }
  648.  
  649.    private boolean maybeAttlistDecl() throws IOException, SAXException {
  650.       InputEntity var1 = this.peekDeclaration("!ATTLIST");
  651.       if (var1 == null) {
  652.          return false;
  653.       } else {
  654.          String var2 = this.getMarkupDeclname("F-016", true);
  655.          ElementDecl var3 = (ElementDecl)this.elements.get(var2);
  656.          if (var3 == null) {
  657.             var3 = new ElementDecl(var2);
  658.             if (!this.ignoreDeclarations) {
  659.                this.elements.put(var2, var3);
  660.             }
  661.          }
  662.  
  663.          this.maybeWhitespace();
  664.  
  665.          for(; !this.peek(">"); this.maybeWhitespace()) {
  666.             var2 = this.maybeGetName();
  667.             if (var2 == null) {
  668.                this.fatal("P-044", new Object[]{new Character(this.getc())});
  669.             }
  670.  
  671.             this.whitespace("F-001");
  672.             AttributeDecl var4 = new AttributeDecl(var2);
  673.             var4.isFromInternalSubset = this.inExternalPE ^ true;
  674.             if (this.peek("CDATA")) {
  675.                var4.type = "CDATA";
  676.             } else if (this.peek("IDREFS")) {
  677.                var4.type = "IDREFS";
  678.             } else if (this.peek("IDREF")) {
  679.                var4.type = "IDREF";
  680.             } else if (this.peek("ID")) {
  681.                var4.type = "ID";
  682.                if (var3.id != null) {
  683.                   if (this.isValidating) {
  684.                      this.error("V-016", new Object[]{var3.id});
  685.                   }
  686.                } else {
  687.                   var3.id = var2;
  688.                }
  689.             } else if (this.peek("ENTITY")) {
  690.                var4.type = "ENTITY";
  691.             } else if (this.peek("ENTITIES")) {
  692.                var4.type = "ENTITIES";
  693.             } else if (this.peek("NMTOKENS")) {
  694.                var4.type = "NMTOKENS";
  695.             } else if (this.peek("NMTOKEN")) {
  696.                var4.type = "NMTOKEN";
  697.             } else if (this.peek("NOTATION")) {
  698.                var4.type = "NOTATION";
  699.                this.whitespace("F-002");
  700.                this.nextChar('(', "F-029", (String)null);
  701.                this.maybeWhitespace();
  702.                Vector var10 = new Vector();
  703.  
  704.                do {
  705.                   if ((var2 = this.maybeGetName()) == null) {
  706.                      this.fatal("P-068");
  707.                   }
  708.  
  709.                   if (this.isValidating && this.notations.get(var2) == null) {
  710.                      this.notations.put(var2, var2);
  711.                   }
  712.  
  713.                   var10.addElement(var2);
  714.                   this.maybeWhitespace();
  715.                   if (this.peek("|")) {
  716.                      this.maybeWhitespace();
  717.                   }
  718.                } while(!this.peek(")"));
  719.  
  720.                var4.values = new String[var10.size()];
  721.  
  722.                for(int var11 = 0; var11 < var10.size(); ++var11) {
  723.                   var4.values[var11] = (String)var10.elementAt(var11);
  724.                }
  725.             } else if (this.peek("(")) {
  726.                var4.type = "ENUMERATION";
  727.                this.maybeWhitespace();
  728.                Vector var5 = new Vector();
  729.  
  730.                do {
  731.                   var2 = this.getNmtoken();
  732.                   var5.addElement(var2);
  733.                   this.maybeWhitespace();
  734.                   if (this.peek("|")) {
  735.                      this.maybeWhitespace();
  736.                   }
  737.                } while(!this.peek(")"));
  738.  
  739.                var4.values = new String[var5.size()];
  740.  
  741.                for(int var6 = 0; var6 < var5.size(); ++var6) {
  742.                   var4.values[var6] = (String)var5.elementAt(var6);
  743.                }
  744.             } else {
  745.                this.fatal("P-045", new Object[]{var2, new Character(this.getc())});
  746.             }
  747.  
  748.             this.whitespace("F-003");
  749.             if (this.peek("#REQUIRED")) {
  750.                var4.isRequired = true;
  751.             } else if (this.peek("#FIXED")) {
  752.                if (this.isValidating && var4.type == "ID") {
  753.                   this.error("V-017", new Object[]{var4.name});
  754.                }
  755.  
  756.                var4.isFixed = true;
  757.                this.whitespace("F-004");
  758.                this.parseLiteral(false);
  759.                if (var4.type != "CDATA") {
  760.                   var4.defaultValue = this.normalize(false);
  761.                } else {
  762.                   var4.defaultValue = this.strTmp.toString();
  763.                }
  764.  
  765.                if (var4.type != "CDATA") {
  766.                   this.validateAttributeSyntax(var4, var4.defaultValue);
  767.                }
  768.             } else if (!this.peek("#IMPLIED")) {
  769.                if (this.isValidating && var4.type == "ID") {
  770.                   this.error("V-018", new Object[]{var4.name});
  771.                }
  772.  
  773.                this.parseLiteral(false);
  774.                if (var4.type != "CDATA") {
  775.                   var4.defaultValue = this.normalize(false);
  776.                } else {
  777.                   var4.defaultValue = this.strTmp.toString();
  778.                }
  779.  
  780.                if (var4.type != "CDATA") {
  781.                   this.validateAttributeSyntax(var4, var4.defaultValue);
  782.                }
  783.             }
  784.  
  785.             if ("xml:lang".equals(var4.name) && var4.defaultValue != null && !this.isXmlLang(var4.defaultValue)) {
  786.                this.error("P-033", new Object[]{var4.defaultValue});
  787.             }
  788.  
  789.             if (!this.ignoreDeclarations && var3.attributes.get(var4.name) == null) {
  790.                var3.attributes.put(var4.name, var4);
  791.                this.dtdListener.attributeDecl(var3.name, var4.name, var4.type, var4.values, var4.defaultValue, var4.isFixed, var4.isRequired);
  792.             }
  793.          }
  794.  
  795.          if (this.isValidating && var1 != this.field_0) {
  796.             this.error("V-013", (Object[])null);
  797.          }
  798.  
  799.          return true;
  800.       }
  801.    }
  802.  
  803.    private boolean maybeComment(boolean var1) throws IOException, SAXException {
  804.       if (!this.field_0.peek(var1 ? "!--" : "<!--", (char[])null)) {
  805.          return false;
  806.       } else {
  807.          boolean var2 = this.doLexicalPE;
  808.          this.doLexicalPE = false;
  809.          boolean var3 = this.lexicalListener instanceof ListenerBase ^ true;
  810.          if (var3) {
  811.             this.strTmp = new StringBuffer();
  812.          }
  813.  
  814.          while(true) {
  815.             try {
  816.                char var4 = this.getc();
  817.                if (var4 == '-') {
  818.                   var4 = this.getc();
  819.                   if (var4 == '-') {
  820.                      this.nextChar('>', "F-022", (String)null);
  821.                      break;
  822.                   }
  823.  
  824.                   if (var3) {
  825.                      this.strTmp.append('-');
  826.                   }
  827.  
  828.                   this.ungetc();
  829.                } else if (var3) {
  830.                   this.strTmp.append((char)var4);
  831.                }
  832.             } catch (EndOfInputException var5) {
  833.                if (this.inExternalPE || !this.donePrologue && this.field_0.isInternal()) {
  834.                   if (this.isValidating) {
  835.                      this.error("V-021", (Object[])null);
  836.                   }
  837.  
  838.                   this.field_0 = this.field_0.pop();
  839.                } else {
  840.                   this.fatal("P-017");
  841.                }
  842.             }
  843.          }
  844.  
  845.          this.doLexicalPE = var2;
  846.          if (var3) {
  847.             this.lexicalListener.comment(this.strTmp.toString());
  848.          }
  849.  
  850.          return true;
  851.       }
  852.    }
  853.  
  854.    private boolean maybeConditionalSect() throws IOException, SAXException {
  855.       if (!this.peek("<![")) {
  856.          return false;
  857.       } else {
  858.          InputEntity var2 = this.field_0;
  859.          this.maybeWhitespace();
  860.          String var1;
  861.          if ((var1 = this.maybeGetName()) == null) {
  862.             this.fatal("P-046");
  863.          }
  864.  
  865.          this.maybeWhitespace();
  866.          this.nextChar('[', "F-030", (String)null);
  867.          if (!"INCLUDE".equals(var1)) {
  868.             if ("IGNORE".equals(var1)) {
  869.                int var3 = 1;
  870.                this.doLexicalPE = false;
  871.  
  872.                while(var3 > 0) {
  873.                   char var4 = this.getc();
  874.                   if (var4 == '<') {
  875.                      if (this.peek("![")) {
  876.                         ++var3;
  877.                      }
  878.                   } else if (var4 == ']' && this.peek("]>")) {
  879.                      --var3;
  880.                   }
  881.                }
  882.             } else {
  883.                this.fatal("P-048", new Object[]{var1});
  884.             }
  885.          } else {
  886.             while(true) {
  887.                while(!this.field_0.isEOF() || this.field_0 == var2) {
  888.                   if (this.field_0.isEOF()) {
  889.                      if (this.isValidating) {
  890.                         this.error("V-020", (Object[])null);
  891.                      }
  892.  
  893.                      this.field_0 = this.field_0.pop();
  894.                   }
  895.  
  896.                   if (this.peek("]]>")) {
  897.                      return true;
  898.                   }
  899.  
  900.                   this.doLexicalPE = false;
  901.                   if (!this.maybeWhitespace() && !this.maybePEReference()) {
  902.                      this.doLexicalPE = true;
  903.                      if (!this.maybeMarkupDecl() && !this.maybeConditionalSect()) {
  904.                         this.fatal("P-047");
  905.                      }
  906.                   }
  907.                }
  908.  
  909.                this.field_0 = this.field_0.pop();
  910.             }
  911.          }
  912.  
  913.          return true;
  914.       }
  915.    }
  916.  
  917.    private boolean maybeDoctypeDecl() throws IOException, SAXException {
  918.       if (!this.peek("<!DOCTYPE")) {
  919.          return false;
  920.       } else {
  921.          ExternalEntity var1 = null;
  922.          this.rootElementName = this.getMarkupDeclname("F-014", true);
  923.          this.dtdListener.startDtd(this.rootElementName);
  924.          if (this.maybeWhitespace() && (var1 = this.maybeExternalID()) != null) {
  925.             this.dtdListener.externalDtdDecl(var1.publicId, var1.systemId);
  926.             this.maybeWhitespace();
  927.          }
  928.  
  929.          if (this.field_0.peekc('[')) {
  930.             this.field_0.startRemembering();
  931.  
  932.             label70:
  933.             while(true) {
  934.                while(!this.field_0.isEOF() || this.field_0.isDocument()) {
  935.                   if (!this.maybeMarkupDecl() && !this.maybePEReference() && !this.maybeWhitespace()) {
  936.                      if (!this.peek("<![")) {
  937.                         this.dtdListener.internalDtdDecl(this.field_0.rememberText());
  938.                         this.nextChar(']', "F-024", (String)null);
  939.                         this.maybeWhitespace();
  940.                         break label70;
  941.                      }
  942.  
  943.                      this.fatal("P-028");
  944.                   }
  945.                }
  946.  
  947.                this.field_0 = this.field_0.pop();
  948.             }
  949.          }
  950.  
  951.          this.nextChar('>', "F-025", (String)null);
  952.          if (var1 != null) {
  953.             var1.name = "(DOCTYPE)";
  954.             var1.isPE = true;
  955.             this.externalParameterEntity(var1);
  956.          }
  957.  
  958.          this.params.clear();
  959.          this.dtdListener.endDtd();
  960.          Vector var2 = new Vector();
  961.          Enumeration var3 = this.notations.keys();
  962.  
  963.          while(var3.hasMoreElements()) {
  964.             String var4 = (String)var3.nextElement();
  965.             Object var5 = this.notations.get(var4);
  966.             if (var5 == Boolean.TRUE) {
  967.                if (this.isValidating) {
  968.                   this.error("V-003", new Object[]{var4});
  969.                }
  970.  
  971.                var2.addElement(var4);
  972.             } else if (var5 instanceof String) {
  973.                if (this.isValidating) {
  974.                   this.error("V-004", new Object[]{var4});
  975.                }
  976.  
  977.                var2.addElement(var4);
  978.             }
  979.          }
  980.  
  981.          while(!var2.isEmpty()) {
  982.             Object var6 = var2.firstElement();
  983.             var2.removeElement(var6);
  984.             this.notations.remove(var6);
  985.          }
  986.  
  987.          return true;
  988.       }
  989.    }
  990.  
  991.    private boolean maybeElement(ElementValidator var1) throws IOException, SAXException {
  992.       boolean var4 = false;
  993.       boolean var5 = true;
  994.       NameCacheEntry var2 = this.maybeGetNameCacheEntry();
  995.       if (var2 == null) {
  996.          return false;
  997.       } else {
  998.          if (var1 != null) {
  999.             var1.consume(var2.name);
  1000.          }
  1001.  
  1002.          ElementDecl var3 = (ElementDecl)this.elements.get(var2.name);
  1003.          if (this.isValidating) {
  1004.             if (var3 == null || var3.contentType == null) {
  1005.                this.error("V-005", new Object[]{var2.name});
  1006.                var3 = new ElementDecl(var2.name);
  1007.                var3.contentType = "ANY";
  1008.                this.elements.put(var2.name, var3);
  1009.             }
  1010.  
  1011.             if (var1 == null && this.rootElementName != null && !this.rootElementName.equals(var2.name)) {
  1012.                this.error("V-006", new Object[]{var2.name, this.rootElementName});
  1013.             }
  1014.          }
  1015.  
  1016.          int var6 = this.field_0.getLineNumber();
  1017.  
  1018.          for(boolean var7 = this.field_0.maybeWhitespace(); !this.field_0.peekc('>'); var4 = true) {
  1019.             if (this.field_0.peekc('/')) {
  1020.                var5 = false;
  1021.                break;
  1022.             }
  1023.  
  1024.             if (!var7) {
  1025.                this.fatal("P-030");
  1026.             }
  1027.  
  1028.             String var8 = this.maybeGetName();
  1029.             if (var8 == null) {
  1030.                this.fatal("P-031", new Object[]{new Character(this.getc())});
  1031.             }
  1032.  
  1033.             if (this.attTmp.getValue(var8) != null) {
  1034.                this.fatal("P-032", new Object[]{var8});
  1035.             }
  1036.  
  1037.             this.field_0.maybeWhitespace();
  1038.             this.nextChar('=', "F-026", var8);
  1039.             this.field_0.maybeWhitespace();
  1040.             this.parseLiteral(false);
  1041.             var7 = this.field_0.maybeWhitespace();
  1042.             AttributeDecl var9 = var3 == null ? null : (AttributeDecl)var3.attributes.get(var8);
  1043.             String var10;
  1044.             if (var9 == null) {
  1045.                if (this.isValidating) {
  1046.                   this.error("V-007", new Object[]{var8, var2.name});
  1047.                }
  1048.  
  1049.                var10 = this.strTmp.toString();
  1050.             } else {
  1051.                if (!"CDATA".equals(var9.type)) {
  1052.                   var10 = this.normalize(var9.isFromInternalSubset ^ true);
  1053.                   if (this.isValidating) {
  1054.                      this.validateAttributeSyntax(var9, var10);
  1055.                   }
  1056.                } else {
  1057.                   var10 = this.strTmp.toString();
  1058.                }
  1059.  
  1060.                if (this.isValidating && var9.isFixed && !var10.equals(var9.defaultValue)) {
  1061.                   this.error("V-008", new Object[]{var8, var2.name, var9.defaultValue});
  1062.                }
  1063.             }
  1064.  
  1065.             if ("xml:lang".equals(var8) && !this.isXmlLang(var10)) {
  1066.                this.error("P-033", new Object[]{var10});
  1067.             }
  1068.  
  1069.             this.attTmp.addAttribute(var8, var9 == null ? "CDATA" : var9.type, var10, var9 == null ? null : var9.defaultValue, true);
  1070.          }
  1071.  
  1072.          if (var3 != null) {
  1073.             this.attTmp.setIdAttributeName(var3.id);
  1074.          }
  1075.  
  1076.          if (var3 != null && var3.attributes.size() != 0) {
  1077.             var4 = this.defaultAttributes(this.attTmp, var3) || var4;
  1078.          }
  1079.  
  1080.          this.docHandler.startElement(var2.name, this.attTmp);
  1081.          if (var4) {
  1082.             this.attTmp.clear();
  1083.          }
  1084.  
  1085.          var1 = this.newValidator(var3);
  1086.          if (var5) {
  1087.             this.content(var3, false, var1);
  1088.             if (!this.field_0.peek(var2.name, var2.chars)) {
  1089.                this.fatal("P-034", new Object[]{var2.name, new Integer(var6)});
  1090.             }
  1091.  
  1092.             this.field_0.maybeWhitespace();
  1093.          }
  1094.  
  1095.          this.nextChar('>', "F-027", var2.name);
  1096.          var1.done();
  1097.          this.docHandler.endElement(var2.name);
  1098.          return true;
  1099.       }
  1100.    }
  1101.  
  1102.    private boolean maybeElementDecl() throws IOException, SAXException {
  1103.       InputEntity var1 = this.peekDeclaration("!ELEMENT");
  1104.       if (var1 == null) {
  1105.          return false;
  1106.       } else {
  1107.          String var2 = this.getMarkupDeclname("F-015", true);
  1108.          ElementDecl var3 = (ElementDecl)this.elements.get(var2);
  1109.          boolean var4 = false;
  1110.          if (var3 != null) {
  1111.             if (var3.contentType != null) {
  1112.                if (this.isValidating && var3.contentType != null) {
  1113.                   this.error("V-012", new Object[]{var2});
  1114.                }
  1115.  
  1116.                var3 = new ElementDecl(var2);
  1117.             }
  1118.          } else {
  1119.             var3 = new ElementDecl(var2);
  1120.             if (!this.ignoreDeclarations) {
  1121.                this.elements.put(var3.name, var3);
  1122.                var4 = true;
  1123.             }
  1124.          }
  1125.  
  1126.          var3.isFromInternalSubset = this.inExternalPE ^ true;
  1127.          this.whitespace("F-000");
  1128.          if (this.peek("EMPTY")) {
  1129.             var3.contentType = "EMPTY";
  1130.             var3.ignoreWhitespace = true;
  1131.          } else if (this.peek("ANY")) {
  1132.             var3.contentType = "ANY";
  1133.             var3.ignoreWhitespace = false;
  1134.          } else {
  1135.             var3.contentType = this.getMixedOrChildren(var3);
  1136.          }
  1137.  
  1138.          this.maybeWhitespace();
  1139.          char var5 = this.getc();
  1140.          if (var5 != '>') {
  1141.             this.fatal("P-036", new Object[]{var2, new Character(var5)});
  1142.          }
  1143.  
  1144.          if (this.isValidating && var1 != this.field_0) {
  1145.             this.error("V-013", (Object[])null);
  1146.          }
  1147.  
  1148.          if (var4) {
  1149.             this.dtdListener.elementDecl(var3.name, var3.contentType);
  1150.          }
  1151.  
  1152.          return true;
  1153.       }
  1154.    }
  1155.  
  1156.    private boolean maybeEntityDecl() throws IOException, SAXException {
  1157.       InputEntity var1 = this.peekDeclaration("!ENTITY");
  1158.       if (var1 == null) {
  1159.          return false;
  1160.       } else {
  1161.          this.doLexicalPE = false;
  1162.          this.whitespace("F-005");
  1163.          SimpleHashtable var3;
  1164.          if (this.field_0.peekc('%')) {
  1165.             this.whitespace("F-006");
  1166.             var3 = this.params;
  1167.          } else {
  1168.             var3 = this.entities;
  1169.          }
  1170.  
  1171.          this.ungetc();
  1172.          this.doLexicalPE = true;
  1173.          String var2 = this.getMarkupDeclname("F-017", false);
  1174.          this.whitespace("F-007");
  1175.          ExternalEntity var4 = this.maybeExternalID();
  1176.          boolean var5 = var3.get(var2) == null;
  1177.          if (!var5 && var3 == this.entities) {
  1178.             this.warning("P-054", new Object[]{var2});
  1179.          }
  1180.  
  1181.          var5 &= this.ignoreDeclarations ^ true;
  1182.          if (var4 == null) {
  1183.             this.doLexicalPE = false;
  1184.             this.parseLiteral(true);
  1185.             this.doLexicalPE = true;
  1186.             if (var5) {
  1187.                char[] var6 = new char[this.strTmp.length()];
  1188.                if (var6.length != 0) {
  1189.                   this.strTmp.getChars(0, var6.length, var6, 0);
  1190.                }
  1191.  
  1192.                InternalEntity var7 = new InternalEntity(var2, var6);
  1193.                var7.isPE = var3 == this.params;
  1194.                var7.isFromInternalSubset = this.inExternalPE ^ true;
  1195.                var3.put(var2, var7);
  1196.                if (var3 == this.entities && !(this.dtdListener instanceof ListenerBase)) {
  1197.                   this.dtdListener.internalEntityDecl(var2, new String(var6));
  1198.                }
  1199.             }
  1200.          } else {
  1201.             if (var3 == this.entities && this.maybeWhitespace() && this.peek("NDATA")) {
  1202.                var4.notation = this.getMarkupDeclname("F-018", false);
  1203.                if (this.isValidating && this.notations.get(var4.notation) == null) {
  1204.                   this.notations.put(var4.notation, Boolean.TRUE);
  1205.                }
  1206.             }
  1207.  
  1208.             var4.name = var2;
  1209.             var4.isPE = var3 == this.params;
  1210.             var4.isFromInternalSubset = this.inExternalPE ^ true;
  1211.             if (var5) {
  1212.                var3.put(var2, var4);
  1213.                if (var4.notation != null) {
  1214.                   this.dtdHandler.unparsedEntityDecl(var2, var4.publicId, var4.systemId, var4.notation);
  1215.                } else if (var3 == this.entities) {
  1216.                   this.dtdListener.externalEntityDecl(var2, var4.publicId, var4.systemId);
  1217.                }
  1218.             }
  1219.          }
  1220.  
  1221.          this.maybeWhitespace();
  1222.          this.nextChar('>', "F-031", var2);
  1223.          if (this.isValidating && var1 != this.field_0) {
  1224.             this.error("V-013", (Object[])null);
  1225.          }
  1226.  
  1227.          return true;
  1228.       }
  1229.    }
  1230.  
  1231.    private ExternalEntity maybeExternalID() throws IOException, SAXException {
  1232.       String var1 = null;
  1233.       if (this.peek("PUBLIC")) {
  1234.          this.whitespace("F-009");
  1235.          var1 = this.parsePublicId();
  1236.       } else if (!this.peek("SYSTEM")) {
  1237.          return null;
  1238.       }
  1239.  
  1240.       ExternalEntity var2 = new ExternalEntity(this.field_0);
  1241.       var2.publicId = var1;
  1242.       this.whitespace("F-008");
  1243.       var2.systemId = this.parseSystemId();
  1244.       return var2;
  1245.    }
  1246.  
  1247.    private String maybeGetName() throws IOException, SAXException {
  1248.       NameCacheEntry var1 = this.maybeGetNameCacheEntry();
  1249.       return var1 == null ? null : var1.name;
  1250.    }
  1251.  
  1252.    private NameCacheEntry maybeGetNameCacheEntry() throws IOException, SAXException {
  1253.       char var1 = this.getc();
  1254.       if (!XmlChars.isLetter(var1) && var1 != ':' && var1 != '_') {
  1255.          this.ungetc();
  1256.          return null;
  1257.       } else {
  1258.          return this.nameCharString(var1);
  1259.       }
  1260.    }
  1261.  
  1262.    private boolean maybeMarkupDecl() throws IOException, SAXException {
  1263.       return this.maybeElementDecl() || this.maybeAttlistDecl() || this.maybeEntityDecl() || this.maybeNotationDecl() || this.maybePI(false) || this.maybeComment(false);
  1264.    }
  1265.  
  1266.    private void maybeMisc(boolean var1) throws IOException, SAXException {
  1267.       while(!var1 || !this.field_0.isEOF()) {
  1268.          if (!this.maybeComment(false) && !this.maybePI(false) && !this.maybeWhitespace()) {
  1269.             break;
  1270.          }
  1271.       }
  1272.  
  1273.    }
  1274.  
  1275.    private boolean maybeNotationDecl() throws IOException, SAXException {
  1276.       InputEntity var1 = this.peekDeclaration("!NOTATION");
  1277.       if (var1 == null) {
  1278.          return false;
  1279.       } else {
  1280.          String var2 = this.getMarkupDeclname("F-019", false);
  1281.          ExternalEntity var3 = new ExternalEntity(this.field_0);
  1282.          this.whitespace("F-011");
  1283.          if (this.peek("PUBLIC")) {
  1284.             this.whitespace("F-009");
  1285.             var3.publicId = this.parsePublicId();
  1286.             if (this.maybeWhitespace()) {
  1287.                if (!this.peek(">")) {
  1288.                   var3.systemId = this.parseSystemId();
  1289.                } else {
  1290.                   this.ungetc();
  1291.                }
  1292.             }
  1293.          } else if (this.peek("SYSTEM")) {
  1294.             this.whitespace("F-008");
  1295.             var3.systemId = this.parseSystemId();
  1296.          } else {
  1297.             this.fatal("P-062");
  1298.          }
  1299.  
  1300.          this.maybeWhitespace();
  1301.          this.nextChar('>', "F-032", var2);
  1302.          if (this.isValidating && var1 != this.field_0) {
  1303.             this.error("V-013", (Object[])null);
  1304.          }
  1305.  
  1306.          if (var3.systemId != null && var3.systemId.indexOf(35) != -1) {
  1307.             this.error("P-056", new Object[]{var3.systemId});
  1308.          }
  1309.  
  1310.          Object var4 = this.notations.get(var2);
  1311.          if (var4 != null && var4 instanceof ExternalEntity) {
  1312.             this.warning("P-063", new Object[]{var2});
  1313.          } else if (!this.ignoreDeclarations) {
  1314.             this.notations.put(var2, var3);
  1315.             this.dtdHandler.notationDecl(var2, var3.publicId, var3.systemId);
  1316.          }
  1317.  
  1318.          return true;
  1319.       }
  1320.    }
  1321.  
  1322.    private boolean maybePEReference() throws IOException, SAXException {
  1323.       if (!this.field_0.peekc('%')) {
  1324.          return false;
  1325.       } else {
  1326.          String var1 = this.maybeGetName();
  1327.          if (var1 == null) {
  1328.             this.fatal("P-011");
  1329.          }
  1330.  
  1331.          this.nextChar(';', "F-021", var1);
  1332.          Object var2 = this.params.get(var1);
  1333.          if (var2 instanceof InternalEntity) {
  1334.             InternalEntity var3 = (InternalEntity)var2;
  1335.             this.pushReader(var3.buf, var1, false);
  1336.          } else if (var2 instanceof ExternalEntity) {
  1337.             this.externalParameterEntity((ExternalEntity)var2);
  1338.          } else if (var2 == null) {
  1339.             this.ignoreDeclarations = true;
  1340.             if (this.isValidating) {
  1341.                this.error("V-022", new Object[]{var1});
  1342.             } else {
  1343.                this.warning("V-022", new Object[]{var1});
  1344.             }
  1345.          }
  1346.  
  1347.          return true;
  1348.       }
  1349.    }
  1350.  
  1351.    private boolean maybePI(boolean var1) throws IOException, SAXException {
  1352.       boolean var2 = this.doLexicalPE;
  1353.       if (!this.field_0.peek(var1 ? "?" : "<?", (char[])null)) {
  1354.          return false;
  1355.       } else {
  1356.          this.doLexicalPE = false;
  1357.          String var3 = this.maybeGetName();
  1358.          if (var3 == null) {
  1359.             this.fatal("P-018");
  1360.          }
  1361.  
  1362.          if ("xml".equals(var3)) {
  1363.             this.fatal("P-019");
  1364.          }
  1365.  
  1366.          if ("xml".equalsIgnoreCase(var3)) {
  1367.             this.fatal("P-020", new Object[]{var3});
  1368.          }
  1369.  
  1370.          if (this.maybeWhitespace()) {
  1371.             this.strTmp = new StringBuffer();
  1372.  
  1373.             try {
  1374.                while(true) {
  1375.                   char var4 = this.field_0.getc();
  1376.                   if (var4 == '?' && this.field_0.peekc('>')) {
  1377.                      break;
  1378.                   }
  1379.  
  1380.                   this.strTmp.append(var4);
  1381.                }
  1382.             } catch (EndOfInputException var5) {
  1383.                this.fatal("P-021");
  1384.             }
  1385.  
  1386.             this.docHandler.processingInstruction(var3, this.strTmp.toString());
  1387.          } else {
  1388.             if (!this.field_0.peek("?>", (char[])null)) {
  1389.                this.fatal("P-022");
  1390.             }
  1391.  
  1392.             this.docHandler.processingInstruction(var3, "");
  1393.          }
  1394.  
  1395.          this.doLexicalPE = var2;
  1396.          return true;
  1397.       }
  1398.    }
  1399.  
  1400.    private String maybeReadAttribute(String var1, boolean var2) throws IOException, SAXException {
  1401.       if (!this.maybeWhitespace()) {
  1402.          if (!var2) {
  1403.             return null;
  1404.          }
  1405.  
  1406.          this.fatal("P-024", new Object[]{var1});
  1407.       }
  1408.  
  1409.       if (!this.peek(var1)) {
  1410.          if (!var2) {
  1411.             this.ungetc();
  1412.             return null;
  1413.          }
  1414.  
  1415.          this.fatal("P-024", new Object[]{var1});
  1416.       }
  1417.  
  1418.       this.maybeWhitespace();
  1419.       this.nextChar('=', "F-023", (String)null);
  1420.       this.maybeWhitespace();
  1421.       return this.getQuotedString("F-035", var1);
  1422.    }
  1423.  
  1424.    private boolean maybeReferenceInContent(ElementDecl var1, ElementValidator var2) throws IOException, SAXException {
  1425.       if (!this.field_0.peekc('&')) {
  1426.          return false;
  1427.       } else if (!this.field_0.peekc('#')) {
  1428.          String var3 = this.maybeGetName();
  1429.          if (var3 == null) {
  1430.             this.fatal("P-009");
  1431.          }
  1432.  
  1433.          this.nextChar(';', "F-020", var3);
  1434.          this.expandEntityInContent(var1, var3, var2);
  1435.          return true;
  1436.       } else {
  1437.          var2.text();
  1438.          this.docHandler.characters(this.charTmp, 0, this.surrogatesToCharTmp(this.parseCharNumber()));
  1439.          return true;
  1440.       }
  1441.    }
  1442.  
  1443.    private void maybeTextDecl() throws IOException, SAXException {
  1444.       if (this.peek("<?xml")) {
  1445.          this.readVersion(false, "1.0");
  1446.          this.readEncoding(true);
  1447.          this.maybeWhitespace();
  1448.          if (!this.peek("?>")) {
  1449.             this.fatal("P-057");
  1450.          }
  1451.       }
  1452.  
  1453.    }
  1454.  
  1455.    private boolean maybeWhitespace() throws IOException, SAXException {
  1456.       if (this.inExternalPE && this.doLexicalPE) {
  1457.          char var1 = this.getc();
  1458.  
  1459.          boolean var2;
  1460.          for(var2 = false; var1 == ' ' || var1 == '\t' || var1 == '\n' || var1 == '\r'; var1 = this.getc()) {
  1461.             var2 = true;
  1462.             if (this.field_0.isEOF() && !this.field_0.isInternal()) {
  1463.                return var2;
  1464.             }
  1465.          }
  1466.  
  1467.          this.ungetc();
  1468.          return var2;
  1469.       } else {
  1470.          return this.field_0.maybeWhitespace();
  1471.       }
  1472.    }
  1473.  
  1474.    private void maybeXmlDecl() throws IOException, SAXException {
  1475.       if (this.peek("<?xml")) {
  1476.          this.readVersion(true, "1.0");
  1477.          this.readEncoding(false);
  1478.          this.readStandalone();
  1479.          this.maybeWhitespace();
  1480.          if (!this.peek("?>")) {
  1481.             char var1 = this.getc();
  1482.             this.fatal("P-023", new Object[]{Integer.toHexString(var1), new Character(var1)});
  1483.          }
  1484.  
  1485.       }
  1486.    }
  1487.  
  1488.    private NameCacheEntry nameCharString(char var1) throws IOException, SAXException {
  1489.       int var2 = 1;
  1490.  
  1491.       for(this.nameTmp[0] = var1; (var1 = this.field_0.getNameChar()) != 0; this.nameTmp[var2++] = var1) {
  1492.          if (var2 >= this.nameTmp.length) {
  1493.             char[] var3 = new char[this.nameTmp.length + 10];
  1494.             System.arraycopy(this.nameTmp, 0, var3, 0, this.nameTmp.length);
  1495.             this.nameTmp = var3;
  1496.          }
  1497.       }
  1498.  
  1499.       return this.nameCache.lookupEntry(this.nameTmp, var2);
  1500.    }
  1501.  
  1502.    ContentModel newContentModel(char var1, ContentModel var2) {
  1503.       return null;
  1504.    }
  1505.  
  1506.    ContentModel newContentModel(String var1) {
  1507.       return null;
  1508.    }
  1509.  
  1510.    ElementValidator newValidator(ElementDecl var1) {
  1511.       return ElementValidator.ANY;
  1512.    }
  1513.  
  1514.    private void nextChar(char var1, String var2, String var3) throws IOException, SAXException {
  1515.       while(this.field_0.isEOF() && !this.field_0.isDocument()) {
  1516.          this.field_0 = this.field_0.pop();
  1517.       }
  1518.  
  1519.       if (!this.field_0.peekc(var1)) {
  1520.          this.fatal("P-008", new Object[]{new Character(var1), messages.getMessage(this.locale, var2), var3 == null ? "" : '"' + var3 + '"'});
  1521.       }
  1522.  
  1523.    }
  1524.  
  1525.    private String normalize(boolean var1) throws SAXException {
  1526.       String var2 = this.strTmp.toString();
  1527.       String var3 = var2.trim();
  1528.       boolean var4 = false;
  1529.       if (var2 != var3) {
  1530.          var2 = var3;
  1531.          var3 = null;
  1532.          var4 = true;
  1533.       }
  1534.  
  1535.       this.strTmp = new StringBuffer();
  1536.  
  1537.       for(int var5 = 0; var5 < var2.length(); ++var5) {
  1538.          char var6 = var2.charAt(var5);
  1539.          if (!XmlChars.isSpace(var6)) {
  1540.             this.strTmp.append(var6);
  1541.          } else {
  1542.             this.strTmp.append(' ');
  1543.  
  1544.             while(true) {
  1545.                ++var5;
  1546.                if (var5 >= var2.length() || !XmlChars.isSpace(var2.charAt(var5))) {
  1547.                   --var5;
  1548.                   break;
  1549.                }
  1550.  
  1551.                var4 = true;
  1552.             }
  1553.          }
  1554.       }
  1555.  
  1556.       if (this.isValidating && this.isStandalone && var1 && (var3 == null || var4)) {
  1557.          this.error("V-019", (Object[])null);
  1558.       }
  1559.  
  1560.       if (var4) {
  1561.          return this.strTmp.toString();
  1562.       } else {
  1563.          return var2;
  1564.       }
  1565.    }
  1566.  
  1567.    public void parse(String var1) throws SAXException, IOException {
  1568.       this.init();
  1569.       InputSource var2 = this.resolver.resolveEntity((String)null, var1);
  1570.       if (var2 == null) {
  1571.          var2 = Resolver.createInputSource(new URL(var1), false);
  1572.       } else if (var2.getSystemId() == null) {
  1573.          this.warning("P-065", (Object[])null);
  1574.          var2.setSystemId(var1);
  1575.       }
  1576.  
  1577.       this.parseInternal(var2);
  1578.    }
  1579.  
  1580.    public void parse(InputSource var1) throws SAXException, IOException {
  1581.       this.init();
  1582.       this.parseInternal(var1);
  1583.    }
  1584.  
  1585.    private int parseCharNumber() throws SAXException, IOException {
  1586.       int var2 = 0;
  1587.       if (this.getc() != 'x') {
  1588.          this.ungetc();
  1589.  
  1590.          while(true) {
  1591.             char var3 = this.getc();
  1592.             if (var3 >= '0' && var3 <= '9') {
  1593.                var2 *= 10;
  1594.                var2 += var3 - 48;
  1595.             } else {
  1596.                if (var3 == ';') {
  1597.                   return var2;
  1598.                }
  1599.  
  1600.                this.fatal("P-049");
  1601.             }
  1602.          }
  1603.       } else {
  1604.          while(true) {
  1605.             char var1 = this.getc();
  1606.             if (var1 >= '0' && var1 <= '9') {
  1607.                var2 <<= 4;
  1608.                var2 += var1 - 48;
  1609.             } else if (var1 >= 'a' && var1 <= 'f') {
  1610.                var2 <<= 4;
  1611.                var2 += 10 + (var1 - 97);
  1612.             } else if (var1 >= 'A' && var1 <= 'F') {
  1613.                var2 <<= 4;
  1614.                var2 += 10 + (var1 - 65);
  1615.             } else {
  1616.                if (var1 == ';') {
  1617.                   return var2;
  1618.                }
  1619.  
  1620.                this.fatal("P-050");
  1621.             }
  1622.          }
  1623.       }
  1624.    }
  1625.  
  1626.    private void parseInternal(InputSource var1) throws SAXException, IOException {
  1627.       if (var1 == null) {
  1628.          this.fatal("P-000");
  1629.       }
  1630.  
  1631.       try {
  1632.          this.field_0 = InputEntity.getInputEntity(this.errHandler, this.locale);
  1633.          this.field_0.init(var1, (String)null, (InputEntity)null, false);
  1634.          this.docHandler.setDocumentLocator(this.locator);
  1635.          this.docHandler.startDocument();
  1636.          this.maybeXmlDecl();
  1637.          this.maybeMisc(false);
  1638.          if (!this.maybeDoctypeDecl() && this.isValidating) {
  1639.             this.warning("V-001", (Object[])null);
  1640.          }
  1641.  
  1642.          this.maybeMisc(false);
  1643.          this.donePrologue = true;
  1644.          if (!this.field_0.peekc('<') || !this.maybeElement((ElementValidator)null)) {
  1645.             this.fatal("P-067");
  1646.          }
  1647.  
  1648.          this.afterRoot();
  1649.          this.maybeMisc(true);
  1650.          if (!this.field_0.isEOF()) {
  1651.             this.fatal("P-001", new Object[]{Integer.toHexString(this.getc())});
  1652.          }
  1653.  
  1654.          this.docHandler.endDocument();
  1655.       } catch (EndOfInputException var9) {
  1656.          if (!this.field_0.isDocument()) {
  1657.             String var5 = this.field_0.getName();
  1658.  
  1659.             do {
  1660.                this.field_0 = this.field_0.pop();
  1661.             } while(this.field_0.isInternal());
  1662.  
  1663.             this.fatal("P-002", new Object[]{var5}, var9);
  1664.          } else {
  1665.             this.fatal("P-003", (Object[])null, var9);
  1666.          }
  1667.       } catch (RuntimeException var10) {
  1668.          throw new SAXParseException(((Throwable)var10).getMessage() != null ? ((Throwable)var10).getMessage() : var10.getClass().getName(), this.locator.getPublicId(), this.locator.getSystemId(), this.locator.getLineNumber(), this.locator.getColumnNumber(), var10);
  1669.       } finally {
  1670.          this.strTmp = null;
  1671.          this.attTmp = null;
  1672.          this.nameTmp = null;
  1673.          this.nameCache = null;
  1674.          if (this.field_0 != null) {
  1675.             this.field_0.close();
  1676.             this.field_0 = null;
  1677.          }
  1678.  
  1679.          this.params.clear();
  1680.          this.entities.clear();
  1681.          this.notations.clear();
  1682.          this.elements.clear();
  1683.          this.afterDocument();
  1684.       }
  1685.  
  1686.    }
  1687.  
  1688.    private void parseLiteral(boolean var1) throws IOException, SAXException {
  1689.       char var2 = this.getc();
  1690.       InputEntity var4 = this.field_0;
  1691.       if (var2 != '\'' && var2 != '"') {
  1692.          this.fatal("P-007");
  1693.       }
  1694.  
  1695.       this.isInAttribute = var1 ^ true;
  1696.       this.strTmp = new StringBuffer();
  1697.  
  1698.       while(true) {
  1699.          while(this.field_0 == var4 || !this.field_0.isEOF()) {
  1700.             char var3;
  1701.             if ((var3 = this.getc()) == var2 && this.field_0 == var4) {
  1702.                this.isInAttribute = false;
  1703.                return;
  1704.             }
  1705.  
  1706.             if (var3 == '&') {
  1707.                String var7 = this.maybeGetName();
  1708.                if (var7 != null) {
  1709.                   this.nextChar(';', "F-020", var7);
  1710.                   if (var1) {
  1711.                      this.strTmp.append('&');
  1712.                      this.strTmp.append(var7);
  1713.                      this.strTmp.append(';');
  1714.                   } else {
  1715.                      this.expandEntityInLiteral(var7, this.entities, var1);
  1716.                   }
  1717.                } else if (this.getc() == '#') {
  1718.                   int var6 = this.parseCharNumber();
  1719.                   if (var6 > 65535) {
  1720.                      var6 = this.surrogatesToCharTmp(var6);
  1721.                      this.strTmp.append(this.charTmp[0]);
  1722.                      if (var6 == 2) {
  1723.                         this.strTmp.append(this.charTmp[1]);
  1724.                      }
  1725.                   } else {
  1726.                      this.strTmp.append((char)var6);
  1727.                   }
  1728.                } else {
  1729.                   this.fatal("P-009");
  1730.                }
  1731.             } else {
  1732.                if (var3 == '%' && var1) {
  1733.                   String var5 = this.maybeGetName();
  1734.                   if (var5 != null) {
  1735.                      this.nextChar(';', "F-021", var5);
  1736.                      if (this.inExternalPE) {
  1737.                         this.expandEntityInLiteral(var5, this.params, var1);
  1738.                      } else {
  1739.                         this.fatal("P-010", new Object[]{var5});
  1740.                      }
  1741.                      continue;
  1742.                   }
  1743.  
  1744.                   this.fatal("P-011");
  1745.                }
  1746.  
  1747.                if (!var1) {
  1748.                   if (var3 == ' ' || var3 == '\t' || var3 == '\n' || var3 == '\r') {
  1749.                      this.strTmp.append(' ');
  1750.                      continue;
  1751.                   }
  1752.  
  1753.                   if (var3 == '<') {
  1754.                      this.fatal("P-012");
  1755.                   }
  1756.                }
  1757.  
  1758.                this.strTmp.append(var3);
  1759.             }
  1760.          }
  1761.  
  1762.          this.field_0 = this.field_0.pop();
  1763.       }
  1764.    }
  1765.  
  1766.    private String parsePublicId() throws IOException, SAXException {
  1767.       String var1 = this.getQuotedString("F-033", (String)null);
  1768.  
  1769.       for(int var2 = 0; var2 < var1.length(); ++var2) {
  1770.          char var3 = var1.charAt(var2);
  1771.          if (" \r\n-'()+,./:=?;!*#@$_%0123456789".indexOf(var3) == -1 && (var3 < 'A' || var3 > 'Z') && (var3 < 'a' || var3 > 'z')) {
  1772.             this.fatal("P-016", new Object[]{new Character(var3)});
  1773.          }
  1774.       }
  1775.  
  1776.       this.strTmp = new StringBuffer();
  1777.       this.strTmp.append(var1);
  1778.       return this.normalize(false);
  1779.    }
  1780.  
  1781.    private String parseSystemId() throws IOException, SAXException {
  1782.       String var1 = this.getQuotedString("F-034", (String)null);
  1783.       int var2 = var1.indexOf(58);
  1784.       if (var2 == -1 || var1.indexOf(47) < var2) {
  1785.          String var3 = this.field_0.getSystemId();
  1786.          if (var3 == null) {
  1787.             this.fatal("P-055", new Object[]{var1});
  1788.          }
  1789.  
  1790.          if (var1.length() == 0) {
  1791.             var1 = ".";
  1792.          }
  1793.  
  1794.          var3 = var3.substring(0, var3.lastIndexOf(47) + 1);
  1795.          if (var1.charAt(0) == '/') {
  1796.             throw new InternalError();
  1797.          }
  1798.  
  1799.          var1 = var3 + var1;
  1800.       }
  1801.  
  1802.       if (var1.indexOf(35) != -1) {
  1803.          this.error("P-056", new Object[]{var1});
  1804.       }
  1805.  
  1806.       return var1;
  1807.    }
  1808.  
  1809.    private boolean peek(String var1) throws IOException, SAXException {
  1810.       return this.field_0.peek(var1, (char[])null);
  1811.    }
  1812.  
  1813.    private InputEntity peekDeclaration(String var1) throws IOException, SAXException {
  1814.       if (!this.field_0.peekc('<')) {
  1815.          return null;
  1816.       } else {
  1817.          InputEntity var2 = this.field_0;
  1818.          if (this.field_0.peek(var1, (char[])null)) {
  1819.             return var2;
  1820.          } else {
  1821.             this.field_0.ungetc();
  1822.             return null;
  1823.          }
  1824.       }
  1825.    }
  1826.  
  1827.    public void pushInputBuffer(char[] var1, int var2, int var3) throws SAXException {
  1828.       if (var3 > 0) {
  1829.          if (var2 != 0 || var3 != var1.length) {
  1830.             char[] var4 = new char[var3];
  1831.             System.arraycopy(var1, var2, var4, 0, var3);
  1832.             var1 = var4;
  1833.          }
  1834.  
  1835.          this.pushReader(var1, (String)null, false);
  1836.       }
  1837.    }
  1838.  
  1839.    private boolean pushReader(ExternalEntity var1) throws SAXException, IOException {
  1840.       if (!var1.isPE && !this.isInAttribute) {
  1841.          this.lexicalListener.startParsedEntity(var1.name);
  1842.       }
  1843.  
  1844.       InputEntity var2 = InputEntity.getInputEntity(this.errHandler, this.locale);
  1845.       InputSource var3 = var1.getInputSource(this.resolver);
  1846.       var2.init(var3, var1.name, this.field_0, var1.isPE);
  1847.       this.field_0 = var2;
  1848.       return true;
  1849.    }
  1850.  
  1851.    private void pushReader(char[] var1, String var2, boolean var3) throws SAXException {
  1852.       if (var3 && !this.isInAttribute) {
  1853.          this.lexicalListener.startParsedEntity(var2);
  1854.       }
  1855.  
  1856.       InputEntity var4 = InputEntity.getInputEntity(this.errHandler, this.locale);
  1857.       var4.init(var1, var2, this.field_0, var3 ^ true);
  1858.       this.field_0 = var4;
  1859.    }
  1860.  
  1861.    private void readEncoding(boolean var1) throws IOException, SAXException {
  1862.       String var2 = this.maybeReadAttribute("encoding", var1);
  1863.       if (var2 != null) {
  1864.          for(int var3 = 0; var3 < var2.length(); ++var3) {
  1865.             char var4 = var2.charAt(var3);
  1866.             if ((var4 < 'A' || var4 > 'Z') && (var4 < 'a' || var4 > 'z') && (var3 == 0 || (var4 < '0' || var4 > '9') && var4 != '-' && var4 != '_' && var4 != '.')) {
  1867.                this.fatal("P-060", new Object[]{new Character(var4)});
  1868.             }
  1869.          }
  1870.  
  1871.          String var5 = this.field_0.getEncoding();
  1872.          if (var5 != null && !var2.equalsIgnoreCase(var5)) {
  1873.             this.warning("P-061", new Object[]{var2, var5});
  1874.          }
  1875.  
  1876.       }
  1877.    }
  1878.  
  1879.    private void readStandalone() throws IOException, SAXException {
  1880.       String var1 = this.maybeReadAttribute("standalone", false);
  1881.       if (var1 != null && !"no".equals(var1)) {
  1882.          if ("yes".equals(var1)) {
  1883.             this.isStandalone = true;
  1884.          } else {
  1885.             this.fatal("P-029", new Object[]{var1});
  1886.          }
  1887.       }
  1888.    }
  1889.  
  1890.    private void readVersion(boolean var1, String var2) throws IOException, SAXException {
  1891.       String var3 = this.maybeReadAttribute("version", var1);
  1892.       if (var1 && var3 == null) {
  1893.          this.fatal("P-025", new Object[]{var2});
  1894.       }
  1895.  
  1896.       if (var3 != null) {
  1897.          int var4 = var3.length();
  1898.  
  1899.          for(int var5 = 0; var5 < var4; ++var5) {
  1900.             char var6 = var3.charAt(var5);
  1901.             if ((var6 < '0' || var6 > '9') && var6 != '_' && var6 != '.' && (var6 < 'a' || var6 > 'z') && (var6 < 'A' || var6 > 'Z') && var6 != ':' && var6 != '-') {
  1902.                this.fatal("P-026", new Object[]{var3});
  1903.             }
  1904.          }
  1905.       }
  1906.  
  1907.       if (var3 != null && !var3.equals(var2)) {
  1908.          this.error("P-027", new Object[]{var2, var3});
  1909.       }
  1910.  
  1911.    }
  1912.  
  1913.    public void setDTDHandler(DTDHandler var1) {
  1914.       if (var1 == null) {
  1915.          var1 = defaultHandler;
  1916.       }
  1917.  
  1918.       this.dtdHandler = (DTDHandler)var1;
  1919.       if (var1 instanceof DtdEventListener) {
  1920.          this.dtdListener = (DtdEventListener)var1;
  1921.       } else {
  1922.          this.dtdListener = defaultHandler;
  1923.       }
  1924.  
  1925.    }
  1926.  
  1927.    public void setDocumentHandler(DocumentHandler var1) {
  1928.       if (var1 == null) {
  1929.          var1 = defaultHandler;
  1930.       }
  1931.  
  1932.       this.docHandler = (DocumentHandler)var1;
  1933.       if (var1 instanceof LexicalEventListener) {
  1934.          this.lexicalListener = (LexicalEventListener)var1;
  1935.       } else {
  1936.          this.lexicalListener = defaultHandler;
  1937.       }
  1938.  
  1939.    }
  1940.  
  1941.    public void setEntityResolver(EntityResolver var1) {
  1942.       this.resolver = var1;
  1943.    }
  1944.  
  1945.    public void setErrorHandler(ErrorHandler var1) {
  1946.       this.errHandler = var1;
  1947.    }
  1948.  
  1949.    public void setFastStandalone(boolean var1) {
  1950.       this.fastStandalone = var1 && !this.isValidating;
  1951.    }
  1952.  
  1953.    private void setHandlers() {
  1954.       if (this.dtdHandler == null) {
  1955.          this.dtdHandler = defaultHandler;
  1956.       }
  1957.  
  1958.       if (this.dtdListener == null) {
  1959.          this.dtdListener = defaultHandler;
  1960.       }
  1961.  
  1962.       if (this.errHandler == null) {
  1963.          this.errHandler = defaultHandler;
  1964.       }
  1965.  
  1966.       if (this.docHandler == null) {
  1967.          this.docHandler = defaultHandler;
  1968.       }
  1969.  
  1970.       if (this.lexicalListener == null) {
  1971.          this.lexicalListener = defaultHandler;
  1972.       }
  1973.  
  1974.    }
  1975.  
  1976.    void setIsValidating(boolean var1) {
  1977.       this.isValidating = var1;
  1978.       if (var1) {
  1979.          this.fastStandalone = false;
  1980.       }
  1981.  
  1982.    }
  1983.  
  1984.    public void setLocale(Locale var1) throws SAXException {
  1985.       if (var1 != null && !messages.isLocaleSupported(var1.toString())) {
  1986.          throw new SAXException(messages.getMessage(this.locale, "P-078", new Object[]{var1}));
  1987.       } else {
  1988.          this.locale = var1;
  1989.       }
  1990.    }
  1991.  
  1992.    private int surrogatesToCharTmp(int var1) throws SAXException {
  1993.       if (var1 <= 65535) {
  1994.          if (XmlChars.isChar(var1)) {
  1995.             this.charTmp[0] = (char)var1;
  1996.             return 1;
  1997.          }
  1998.       } else if (var1 <= 1114111) {
  1999.          var1 -= 65536;
  2000.          this.charTmp[0] = (char)('\ud800' | var1 >> 10 & 1023);
  2001.          this.charTmp[1] = (char)('\udc00' | var1 & 1023);
  2002.          return 2;
  2003.       }
  2004.  
  2005.       this.fatal("P-051", new Object[]{Integer.toHexString(var1)});
  2006.       return -1;
  2007.    }
  2008.  
  2009.    private void ungetc() {
  2010.       this.field_0.ungetc();
  2011.    }
  2012.  
  2013.    void validateAttributeSyntax(AttributeDecl var1, String var2) throws SAXException {
  2014.    }
  2015.  
  2016.    private void warning(String var1, Object[] var2) throws SAXException {
  2017.       SAXParseException var3 = new SAXParseException(messages.getMessage(this.locale, var1, var2), this.locator);
  2018.       this.errHandler.warning(var3);
  2019.    }
  2020.  
  2021.    private void whitespace(String var1) throws IOException, SAXException {
  2022.       if (!this.maybeWhitespace()) {
  2023.          this.fatal("P-004", new Object[]{messages.getMessage(this.locale, var1)});
  2024.       }
  2025.  
  2026.    }
  2027. }
  2028.